/******************************************************************************
GameGuts.h: interface for the GameGuts class.

Copyright (c) 2005 - Realtime Gaming.  All rights reserved.
******************************************************************************/

#if !defined(_GAMEGUTS_H_)
#define _GAMEGUTS_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "lib.h"
#include "tracksql.h"

#ifdef FORCED_KENO
#include "GameForcedResults.h"
#endif

/******************************************************************************
Forward Declarations
******************************************************************************/
class GameConnection;
class SubGame;

/******************************************************************************
class GameGuts - base class for classes implementing game-specific logic for
                 the GameConnection class.
******************************************************************************/
class GameGuts  
{
protected:
	GameGuts(GameConnection* connection);

public:
	virtual ~GameGuts();
    
    //Factory Method for GameGuts instances
    static GameGuts* CreateGuts(uint8 machid, GameConnection* connection);

    void    setCompFactor(int32 compFactor);
    int32   getCompFactor() const;

private:
    //Don't copy or assign
    GameGuts(const GameGuts&);
    GameGuts& operator=(const GameGuts&);

public:     //Abstract and Virtual Methods
    virtual uint8   getGameID() const = 0;
    virtual uint8   getMachineID() const = 0;
    virtual int32   getMinBet() const = 0;
    virtual int32   getMaxBet() const = 0;
    virtual uint8   getMaxCards() const = 0;
    virtual uint8   getMaxGames() const = 0;
    virtual uint8   getPaytable() const = 0;
	virtual int32	getDenomValue(int32 index) const = 0;

    virtual void    processBet(uint8* buf, 
                               int32 len, int32 num_cards, 
                               int32 num_games) = 0;

    virtual int32   getPlayerLimits(const PID& pid, int32* compFactor) = 0;
	virtual int32	getDenominations() = 0;

    virtual bool8   allowsMultipliers() const;    
    virtual void    processMultiplierResponse(uint8* msgbuf, int32 nMsgLen);
	virtual void	processSubGameMessage();

    virtual bool8   getSavedGame();

    virtual void    sendSavedGame() = 0;

    virtual bool8   hasSubGame() const;

#ifdef FORCED_KENO
	virtual void	loadForcedResults();
#endif

protected:   //Message Response & Other Helpers
    void    answer(uint8 answer);
    void    addToResponse(uint8 add_byte);
    void    addToResponse(int8 add_sbyte);
    void    addToResponse(int32 add_int);
    void    startResponse();
    void    endResponse();
    void    allocateSubGameData();

protected:   //Data
    GameConnection* m_connection;
    int32           m_compFactor;
    SubGame*        m_subGame;
	int32			m_anDenomValues[5];		//psharpless  11/3/06  cases#: 9360 & 16436
#ifdef FORCED_KENO
	GameForcedResults* m_forcedResults;
#endif
};

#endif // !defined(_GAMEGUTS_H_)
